# Process raw unemployment rate data got from BLS QCEW Database.


BEGIN {
  OFS = ","
  split("Jan Feb Mar Apr May Jun	Jul	Aug	Sep	Oct	Nov	Dec Annual", mons)
  print "County", "Year", "Month", "unempRate"
}

{
  if ($1 ~ /^\*Area:/) {
    county = substr($2,2)
    if ($4 ~ /County/) {
      county = county " " $3
    }
    next
  }

  if ($1 ~ /^20[01][0-9]$/) {
    year = $1
    for(i=2; i<=NF; ++i) {
      print county, year, mons[i-1], $i
    }
  }
}
